﻿using System;
using System.Collections.Generic;
using System.Web;

/// <summary>
///MessageBox 的摘要说明
/// </summary>
public class MessageBox {
    public MessageBox() {
        //
        //TODO: 在此处添加构造函数逻辑
        //
    }

    public static void AlertThenRefresh(System.Web.UI.Page page, string msg) {
        page.RegisterStartupScript("message", "<script language='javascript' defer>alert('" + msg.ToString() + "');window.location.href=window.location.href;</script>");
    }

    public static void AlertThenRedirect(System.Web.UI.Page page, string msg, string refrashPage) {
        page.RegisterStartupScript("message", "<script language='javascript' defer>alert('" + msg.ToString() + "');window.location='" + refrashPage.ToString() + "';</script>");
    }
}
